#include <iostream>
// #include <stl_algo.h>
#include <algorithm>
using namespace std;

string int2binary(int &a){
    string result;
    while(a){
        result += '0'+ a%2;
        a = a/2;
    }
    reverse(result.begin(),result.end());
    // cout <<result<<endl;
    return result;
}
int found_num(string &str){
    int len = str.length();
    int num = 0;
    for (int i = 0; i < len; i++){
        if (str[i] == '1')
            num++;
    }
    cout << num << endl;
    return num;
}
int main(int agrc, char ** agrv){
    int num;
    while(cin >> num){
        int *ptr = &num;
        string str=int2binary(*ptr);
        found_num(str);
    }
    return 0;
}